package com.syh.jn.scm.infrastructure.repository.model.stock;

import com.syh.core.ddd.infrastructure.repository.model.SuperBusinessModel;
import lombok.*;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.math.BigDecimal;

/**
 * 出入库记录子项
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Entity
@Table(name = "T_STOCK_STOCK_RECORD_ITEM")
@EqualsAndHashCode(callSuper = true)
public class StockRecordItemModel extends SuperBusinessModel {
  /**
   * 出入库单号id
   */
  @Column(name = "RECORD_ORDER_ID", columnDefinition = "bigint COMMENT '出入库单号'")
  private Long recordOrderId;
  /**
   * 对应订单ITEMId
   */
  @Column(name = "ORDER_ITEM_ID", columnDefinition = "bigint COMMENT '对应订单ITEMId'")
  private Long orderItemId;
  /**
   * 订单类型
   */
  @Column(name = "ORDER_TYPE", columnDefinition = "smallint COMMENT '订单类型 1：销售出库 2：销售退货入库 3：采购入库 4：采购退货出库'")
  private Short orderType;
  /**
   * 商品ID
   */
  @Column(name = "GOODS_ID", columnDefinition = "bigint COMMENT '商品ID'")
  private Long goodsId;
  /**
   * 商品编码
   */
  @Column(name = "GOODS_CODE", columnDefinition = "varchar(50) COMMENT '商品编码'")
  private String goodsCode;
  /**
   * 商品名称
   */
  @Column(name = "GOODS_NAME", columnDefinition = "varchar(50) COMMENT '商品名称'")
  private String goodsName;
  /**
   * 所属种类,应用分类编码
   */
  @Column(name = "CATEGORY_CATALOG_CODE", columnDefinition = "varchar(50) COMMENT '所属种类,应用分类的父类目录'", length = 50)
  private String categoryCatalogCode;
  /**
   * 分类id
   */
  @Column(name = "CATEGORY_ID", columnDefinition = "bigint COMMENT '分类id'")
  private Long categoryId;
  /**
   * 所属分类名称
   */
  @Column(name = "CATEGORY_NAME", columnDefinition = "varchar(50) COMMENT '所属分类名称'")
  private String categoryName;
  /**
   * 品牌id
   */
  @Column(name = "GOODS_BRAND_ID", columnDefinition = "bigint COMMENT '品牌id'")
  private Long goodsBrandId;
  /**
   * 品牌名称
   */
  @Column(name = "GOODS_BRAND_NAME", columnDefinition = "varchar(50) COMMENT '品牌名称'")
  private String goodsBrandName;
  /**
   * 出入库数量
   */
  @Column(name = "QUANTITY", columnDefinition = "decimal(19,2) COMMENT '出入库数量'")
  private BigDecimal quantity;
  /**
   * 商品单价
   */
  @Column(name = "PRICE", columnDefinition = "decimal(19,2) COMMENT '商品单价'")
  private BigDecimal price;
  /**
   * 默认销售税率
   */
  @Column(name = "SALES_TAX_RATE", columnDefinition = "decimal(19,2) COMMENT '默认销售税率'")
  private BigDecimal salesTaxRate;
  /**
   * 纳税人类型: 1：一般纳税人 2：小规模纳税人 3:其他
   */
  @Column(name = "TAXPAYER", columnDefinition = "smallint COMMENT '纳税人类型: 1：一般纳税人 2：小规模纳税人 3:其他'")
  private Short taxpayer;
  /**
   * 规格
   */
  @Column(name = "SPEC_NAME", columnDefinition = "varchar(50) COMMENT '规格'")
  private String specName;
  /**
   * 计量单位
   */
  @Column(name = "UNITS", columnDefinition = "varchar(50) COMMENT '计量单位'")
  private String units;
  /**
   * 与基础商品转换率（如果是基础商品 则等于1）
   */
  @Column(name = "CONVERSION_RATE", columnDefinition = "decimal(19,2) COMMENT '与基础商品转换率（如果是基础商品 则等于1）'")
  private BigDecimal conversionRate;
}
